package org.nanotek.dao.spring.impl;

import java.util.List;

import org.nanotek.beans.ArtistCredit;
import org.nanotek.beans.Track;
import org.nanotek.dao.spring.TrackDAO;

@SuppressWarnings({"serial","unchecked"})
public class TrackDAOImpl extends GeneralPurposeDAO implements TrackDAO<Track>{

	public Track findById (String id)
	{ 
		return (Track) getHibernateTemplate().get(clazz, id);
	}

	@Override
	public <A extends ArtistCredit> List<Track> findTrackByArtistCredit(A artistCredit) {
		String jpql = "Select t from Track where t.artistCredit = ?";
		return getHibernateTemplate().find(jpql, artistCredit.getArtistCreditId());
	}
	
}
